<? 
	require("required/dbconnect.php"); 
	require("required/share_function.php");

	
	
	if(empty($_GET['type']))
	{
		$type="aboutus";
	}
	else
	{
		$type=$_GET['type'];
	}
	
	
	$_SESSION['pid']=$type;
	
	if(empty($_GET['pid']))
	{
		$pid=1;
		
	}
	else
	{
		$pid=$_GET['pid'];
		
	}
	
	if(empty($_GET['id']))
	{
		$get_content=mysql_query("select * from os_contents where content_type='$type' and status='1' order by order_id asc limit 1");
		
	}else{
		
		$id=$_GET['id'];
		$get_content=mysql_query("select * from os_contents where id='$id' order by order_id asc limit 1");
			
	}
	$a=mysql_fetch_array($get_content,MYSQL_ASSOC);
	$title=$a['title'];
?>

<? 

require("required/header.php"); 
require("required/function.php"); 
?>
<table cellpadding="6" cellspacing="0" width="100%">
    <tr>
    	<Td>
        	 <table width="100%">
              <Td class="page_location">Your Location : <a href="index.php">Home</a>  > 
             <?= getTypeName($type) ?> > <?= $a['title'] ?></Td>
          </table>
        </Td>
    </tr>
    <tr valign="top">
       
        <td class='page_title_bar' colspan="2">
            <?= getTypeName($type) ?>
        </td>					
    </tr>	
<?
if(mysql_num_rows($get_content)==0)
{
?>
<tr>
	<td>
    	<div class="dw_failed">No record found</div>
    </td>
</tr>
<?	
}
else
{
    
	$get_all=mysql_query("select id,title from os_contents where content_type='$type' and status='1' order by order_id asc")or die(mysql_error());

?>
 <tr>
    <Td align="left">
        <?
            if(mysql_num_rows($get_all)>1){
            while($g=mysql_fetch_array($get_all,MYSQL_ASSOC))
            {
                if($g['id']==$a['id'])
                {
        ?>
        <?= $g['title'] ?> |
        <? }else{ ?>
        <a href="os_content.php?type=<?= $type ?>&pid=<?= $pid ?>&id=<?= $g['id'] ?>" style="color:#FF0000"><?= $g['title'] ?> </a>|
        
        <? } ?>
        
        <? }}else{ ?>
        <br />
        
        
        <? } ?>
    
    </Td>
</tr>
<tr>
	<td valign="top" width="80%">
   		<table width="100%" align="center">
    		<td align="left" valign="top">
    			<div class="title"><?= $a['title'] ?></div>
    			<br />
    			<?= $a['content'] ?>
	    	</td>
    	</table>
    <br /><br />
	</td>
</Tr>
<? } ?>
</table>
<? require("required/footer.php"); ?>             